<form enctype="multipart/form-data" method="post" name="fileinfo" action="admin/Adminmember/postexcel">
    <div class="layui-form-item">
        <div class="layui-upload">
            <button type="button" class="layui-btn layui-btn-normal" id="test8">选择文件</button>
            <button type="button" class="layui-btn" id="test9">开始上传</button>
        </div>
    </div>
    <script>window.form.render();</script>
</form>
<script>
    layui.use('upload', function(){
        var $ = layui.jquery
            ,upload = layui.upload;
        //选完文件后不自动上传
        upload.render({
            elem: '#test8'
            ,url: '/admin/Adminmember/postexcel/'
            ,auto: false
            ,exts: 'xlsx|xls|csv'
            ,multiple: true
            ,bindAction: '#test9'
            ,done: function(data){
                layer.alert(data.msg)
            }
        });
    });
    window.form.render();
</script>

